package com.wanghaoran.dto;

import com.wanghaoran.constant.MC;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author wanghaoran
 */
@Schema(description = "员工修改DTO")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class EmpUpdateDTO implements Serializable {

    @Schema(description = "员工主键")
    @NotNull(message = "员工主键不能为空")
    private Long id;

    @Schema(description = "手机号码")
    @Pattern(regexp = MC.Regex.PHONE_RE, message = MC.Regex.PHONE_RE_MSG)
    private String phone;

    @Schema(description = "微信号码")
    private String wechat;

    @Schema(description = "电子邮箱")
    @Pattern(regexp = MC.Regex.EMAIL_RE, message = MC.Regex.EMAIL_RE_MSG)
    private String email;

    @Schema(description = "员工性别")
    @Min(value = 0, message = "性别必须为0、1或2")
    @Max(value = 2, message = "性别必须为0、1或2")
    private Integer gender;

    @Schema(description = "员工年龄")
    @Min(value = 18, message = "年龄不能小于18岁")
    @Max(value = 60, message = "年龄不能大于60岁")
    private Integer age;

    @Schema(description = "所在省份")
    @Pattern(regexp = MC.Regex.PROVINCE_RE, message = MC.Regex.PROVINCE_RE_MSG)
    private String province;

    @Schema(description = "详细住址")
    @Pattern(regexp = MC.Regex.ADDRESS_RE, message = MC.Regex.ADDRESS_RE_MSG)
    private String address;

    @Schema(description = "真实姓名")
    @Pattern(regexp = MC.Regex.REALNAME_RE, message = MC.Regex.REALNAME_RE_MSG)
    private String realname;

    @Schema(description = "身份证号")
    @Pattern(regexp = MC.Regex.ID_CARD_RE, message = MC.Regex.ID_CARD_RE_MSG)
    private String idcard;

    @Schema(description = "部门外键")
    private Long fkDeptId;

    @Schema(description = "员工描述")
    @Pattern(regexp = MC.Regex.INFO_RE, message = MC.Regex.INFO_RE_MSG)
    private String info;

    @Schema(description = "入职日期")
    private LocalDateTime hiredate;


}
